home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #14 / Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO / prog_bas / pclvbw10.zip / PCLVBW_R.DOC < prev    next >
Text File  |  1996-02-16  |  51KB  |  1,429 lines

  1.  
  2.  
  3.                    Personal Communications Library
  4.  
  5.                       For Visual BASIC / Windows
  6.  
  7.  
  8.                               (PCLVBW)
  9.  
  10.  
  11.  
  12.                          REFERENCE MANUAL
  13.  
  14.  
  15.  
  16.  
  17.  
  18.                             Version  1.0
  19.  
  20.                             Feb 11, 1996
  21.  
  22.  
  23.  
  24.  
  25.                  This software is provided as-is.
  26.           There are no warranties, expressed or implied.
  27.  
  28.  
  29.  
  30.  
  31.                        Copyright (C) 1996
  32.                        All rights reserved
  33.  
  34.  
  35.  
  36.                    MarshallSoft Computing, Inc.
  37.                        Post Office Box 4543
  38.                        Huntsville AL 35815
  39.  
  40.                        Voice 205-881-4630
  41.                        FAX   205|881|4630
  42.                        BBS   205-880-9748
  43.  
  44.  
  45.                               _______
  46.                          ____|__     |                (R)
  47.                       --+       |    +-------------------
  48.                         |   ____|__  |  Association of
  49.                         |  |       |_|  Shareware
  50.                         |__|   o   |    Professionals
  51.                       --+--+   |   +---------------------
  52.                            |___|___|    MEMBER
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  PCL4VB   Reference   Manual                                       Page 1
  69.                         C O N T E N T S
  70.  
  71.  
  72.  
  73.     Chapter                                     Page
  74.  
  75.     Table of Contents.............................2
  76.     Introduction..................................3
  77.        SioBaud....................................4
  78.        SioBrkSig..................................4
  79.        SioCTS.....................................5
  80.        SioDCD.....................................5
  81.        SioDone....................................6
  82.        SioDSR.....................................6
  83.        SioDTR.....................................7
  84.        SioFIFO....................................7
  85.        SioFlow....................................8
  86.        SioGetc....................................8
  87.        SioGetDiv..................................9
  88.        SioInfo....................................9
  89.        SioIRQ....................................10
  90.        SioLine...................................10
  91.        SioLoopBack...............................11
  92.        SioModem..................................11
  93.        SioParms..................................12
  94.        SioPorts..................................12
  95.        SioPutc...................................13
  96.        SioRead...................................13
  97.        SioReset..................................14
  98.        SioRI.....................................14
  99.        SioRTS....................................15
  100.        SioRxBuf..................................15
  101.        SioRxClear................................16
  102.        SioRxQue..................................16
  103.        SioTxBuf..................................17
  104.        SioTxClear................................17
  105.        SioTxFlush................................18
  106.        SioTxQue..................................18
  107.        SioUART...................................19
  108.        SioUnGetc.................................19
  109.     Function Summary.............................20
  110.     Error Code Summary...........................21
  111.     Code Examples................................21
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  PCL4VB   Reference   Manual                                       Page 2
  137.                       Introduction
  138.  
  139.  
  140.  
  141.   This  manual  lists all of the PCLVBW functions in alphabetical order. Every
  142.   library function returns a value as follows:
  143.  
  144.   1.  Negative values for error conditions. The last page of this manual lists
  145.       all error values and their meanings.
  146.  
  147.   2.  Non-negative values when returning data (eg: SioLine).
  148.  
  149.   3.  Zero otherwise. Note that a zero or positive return value  is  never  an
  150.       error.
  151.  
  152.   When  debugging an application, all return values should be tested. Refer to
  153.   page 23 "Error Code Summary" for a textual description of the error codes.
  154.  
  155.   There are two versions of the  library.  One  version  is  with  transmitter
  156.   interrupts  disabled  and  one  with them enabled (the default). The default
  157.   library is normally chosen.
  158.  
  159.   Refer to the User's Manual (PCLVBW.USR) for additional information.
  160.  
  161.   It  is  also  recommended  that the two example programs SIMPLE and LOGIN be
  162.   studied as examples of calling the library functions.  Refer  to  the  Users
  163.   Manual for a description of the example programs.
  164.  
  165.   All data and function types are integer unless otherwise specified.
  166.   ( DEFINT A-Z ).
  167.  
  168.   IMPORTANT
  169.  
  170.   Be  sure  to  read  the  README.DOC file. It contains last release notes and
  171.   other last minutes changes and/or additions.
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  PCL4VB   Reference   Manual                                       Page 3
  205.   +-------------+------------------------------------------------------------+
  206.   |   SioBaud   |  Sets the baud rate of the selected port.                  |
  207.   +-------------+------------------------------------------------------------+
  208.  
  209.  
  210.     Syntax    FUNCTION SioBaud(ByVal Port,ByVal BaudCode)
  211.               REM Port:      Port selected (COM1 - COM20)
  212.               REM BaudCode:  Baud code [not baud rate]
  213.  
  214.    Remarks    The  SioBaud  function sets the baud rate without resetting  the
  215.               port. It is used to change the baud rate after calling SioReset.
  216.  
  217.                Code   Rate    Name             Code   Rate   Name
  218.                  0     300    Baud300            5    9600   Baud9600
  219.                  1     600    Baud600            6   19200   Baud19200
  220.                  2    1200    Baud1200           7   38400   Baud38400
  221.                  3    2400    Baud2400           8   57600   Baud57600
  222.                  4    4800    Baud4800           9  115200   Baud115200
  223.  
  224.  
  225.    Returns     -4 : No such port. Expect 0 to MaxPort.
  226.               -11 : Bad baud rate code. See above code values.
  227.  
  228.   See Also    SioReset
  229.  
  230.  
  231.  
  232.  
  233.  
  234.   +-------------+------------------------------------------------------------+
  235.   |  SioBrkSig  |  Asserts, cancels, or detects BREAK signal.                |
  236.   +-------------+------------------------------------------------------------+
  237.  
  238.  
  239.     Syntax    FUNCTION SioBrkSig(ByVal Port,ByVal Cmd)
  240.               REM Port:      Port selected (COM1 thru COM20)
  241.               REM char Cmd:  ASSERT, CANCEL, or DETECT
  242.  
  243.    Remarks    The SioBrkSig function controls the BREAK bit in the line status
  244.               register. The legal commands are:
  245.  
  246.               ASSERT_BREAK ('A') to assert BREAK
  247.               CANCEL_BREAK ('C') to cancel BREAK
  248.               DETECT_BREAK ('D') to detect BREAK
  249.  
  250.               ASSERT_BREAK, CANCEL_BREAK,  and  DETECT_BREAK  are  defined  in
  251.               PCLVBW.BAS. See TERM.BAS for an example of the use of SioBrkSig.
  252.  
  253.    Returns    -2 : Port not enabled. Call SioReset first.
  254.               -4 : No such port. Expect 0 to MaxPort.
  255.               -6 : Illegal command. Expected 'A', 'C', or 'D'.
  256.               >0 : BREAK signal detected (DETECT command only)
  257.  
  258.   See Also    SioBrkKey
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  PCL4VB   Reference   Manual                                       Page 4
  273.   +-------------+------------------------------------------------------------+
  274.   |   SioCTS    |  Reads the Clear to Send (CTS) modem status bit.           |
  275.   +-------------+------------------------------------------------------------+
  276.  
  277.     Syntax    FUNCTION SioCTS(ByVal Port)
  278.               REM Port: Port selected (COM1 thru COM20)
  279.  
  280.    Remarks    The SioCTS function is used to read  the  Clear  to  Send  (CTS)
  281.               modem status bit.
  282.  
  283.               The  CTS  line  is  used  by  some  error  correcting  modems to
  284.               implement hardware flow control.  CTS is dropped by the modem to
  285.               signal the computer not to send data  and is  raised  to  signal
  286.               the computer to continue.
  287.  
  288.               Refer to the User's Manual for a discussion of flow control.
  289.  
  290.    Returns    -2 : Port not enabled. Call SioReset first.
  291.               -4 : No such port.  Expect 0 to MaxPort.
  292.                0 : CTS is clear.
  293.               >0 : CTS is set.
  294.  
  295.   See Also    SioFlow, SioDSR, SioRI, SioDCD, and SioModem.
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.   +-------------+------------------------------------------------------------+
  306.   |   SioDCD    |  Reads the Data Carrier Detect (DCD) modem staus bit.      |
  307.   +-------------+------------------------------------------------------------+
  308.  
  309.  
  310.     Syntax    FUNCTION SioDCD(ByVal Port)
  311.               REM Port: Port selected (COM1 thru COM20)
  312.  
  313.    Remarks    The  SioDCD  function is  used to read the Data Carrier Detect
  314.               (DCD) modem status bit. Also see SioModem.
  315.  
  316.    Returns    -2 : Port not enabled. Call SioReset first.
  317.               -4 : No such port.  Expect 0 to MaxPort.
  318.                0 : DCD is clear.
  319.               >0 : DCD is set.
  320.  
  321.   See Also    SioDSR, SioCTS, SioRI, and SioModem.
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  PCL4VB   Reference   Manual                                       Page 5
  341.   +-------------+------------------------------------------------------------+
  342.   |   SioDone   |  Terminates further serial processing.                     |
  343.   +-------------+------------------------------------------------------------+
  344.  
  345.  
  346.     Syntax    FUNCTION SioDone(ByVal Port)
  347.               REM Port: Port selected (COM1 thru COM20)
  348.  
  349.    Remarks    The  SioDone  function  terminates  further  serial  processing.
  350.               SioDone  MUST  be called before exiting your application so that
  351.               interrupts can be restored to their original state.  Failure  to
  352.               do  this  can crash the operating system.  If you forget to call
  353.               SioDone before exiting, be sure to re-boot your  computer.   You
  354.               can  call SioDone even if SioReset has not been called, so it is
  355.               good  practice  to  always  call  SioDone  before  exiting  your
  356.               application.
  357.  
  358.               Also  note  that  SioDone  dereferences the transmit and receive
  359.               buffers set up by SioRxQue and SioTxQue.
  360.  
  361.    Returns    -2 : Port not enabled. Call SioReset first.
  362.               -4 : No such port. Expect 0 to MaxPort.
  363.  
  364.   See Also    SioReset.
  365.  
  366.  
  367.  
  368.  
  369.   +-------------+------------------------------------------------------------+
  370.   |    SioDSR   |  Reads the Data Set Ready (DSR) modem status bit.          |
  371.   +-------------+------------------------------------------------------------+
  372.  
  373.  
  374.     Syntax    FUNCTION SioDSR(ByVal Port)
  375.               REM Port: Port selected (COM1 thru COM20)
  376.  
  377.    Remarks    The SioDSR function is used to read the  Data  Set  Ready  (DSR)
  378.               modem status bit.
  379.  
  380.    Returns    -2 : Port not enabled. Call SioReset first.
  381.               -4 : No such port.  Expect 0 to MaxPort.
  382.                0 : DSR is clear.
  383.               >0 : DSR is set
  384.  
  385.   See Also    SioCTS, SioRI, SioDCD, and SioModem
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  PCL4VB   Reference   Manual                                       Page 6
  409.   +-------------+------------------------------------------------------------+
  410.   |    SioDTR   |  Set, clear, or read Data Terminal Ready (DTR) status bit. |
  411.   +-------------+------------------------------------------------------------+
  412.  
  413.  
  414.     Syntax    FUNCTION SioDTR(ByVal Port,ByVal Cmd)
  415.               REM Port: Port selected (COM1 thru COM20)
  416.               REM Cmd:  DTR command (SET, CLEAR, or READ)
  417.  
  418.    Remarks    The SioDTR function controls the Data Terminal Ready (DTR) bit
  419.               in the modem control register.  DTR should always  be  set  when
  420.               communicating with a modem.  Commands  (defined  in  PCLVBW.BAS)
  421.               are:
  422.  
  423.               SET_LINE ('S')  to set DTR (ON)
  424.               CLEAR_LINE ('C')  to clear DTR (OFF)
  425.               READ_LINE ('R')  to read DTR
  426.  
  427.    Returns    -2 : Port not enabled. Call SioReset first.
  428.               -4 : No such port. Expect 0 to MaxPort.
  429.               -5 : Not one of 'S', 'C', or 'R'.
  430.                0 : DTR is OFF (READ_LINE Command).
  431.               >0 : DTR is ON (READ_LINE Command).
  432.  
  433.   See Also    SioRTS.
  434.  
  435.  
  436.  
  437.  
  438.   +-------------+------------------------------------------------------------+
  439.   |   SioFIFO   |  Sets the FIFO trigger level (16550 UART only).            |
  440.   +-------------+------------------------------------------------------------+
  441.  
  442.  
  443.     Syntax    FUNCTION SioFIFO(ByVal Port,ByVal LevelCode)
  444.               REM Port:      Port selected (COM1 thru COM20)
  445.               REM LevelCode: FIFO level code (see below)
  446.  
  447.    Remarks    The SioFIFO function  is  used to enable both transmit & receive
  448.               FIFOs for 16550 UARTS, and to set the  trigger  level  at  which
  449.               receive interrupts are generated.
  450.  
  451.               For  example, if the FIFO level is set to 8, then the 16550 UART
  452.               will not generate an interrupt until 8 bytes have been received.
  453.               This reduces the  number  of  interrupts  generated  and  allows
  454.               faster   processing   with   slower  machines.
  455.  
  456.               In order to test if your port is a 16550 UART, call SioFIFO with
  457.               a  LevelCode  of  other than FIFO_OFF. SioFIFO can be called for
  458.               the 8250 and 16450 UART without ill effect.
  459.  
  460.               Code  PCLVBW.BAS Name Trigger Level
  461.               -1      FIFO_OFF     Disable FIFO
  462.                0      LEVEL_1      1 byte
  463.                1      LEVEL_4      4 bytes
  464.                2      LEVEL_8      8 bytes   [Recommended]
  465.                3      LEVEL_14     14 bytes
  466.  
  467.    Returns    -2 : Port not enabled. Call SioReset first.
  468.               -4 : No such port.  Expect 0 to MaxPort.
  469.               >0 : FIFO level set.
  470.                0 : FIFO level not set (not 16550).
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  PCL4VB   Reference   Manual                                       Page 7
  477.   +------------+-------------------------------------------------------------+
  478.   |   SioFlow  |  Sets hardware (RTS/CTS) flow control.                      |
  479.   +------------+-------------------------------------------------------------+
  480.  
  481.  
  482.     Syntax    FUNCTION SioFlow(ByVal Port,ByVal Tics)
  483.               REM Port: Port selected (COM1 thru COM20)
  484.               REM Tics: # tics before TX timeout [due to CTS=0]
  485.  
  486.    Remarks    The SioFlow function is used to enable or disable hardware  flow
  487.               control.  Hardware flow control uses RTS and CTS to control data
  488.               flow  between  the  modem  and the computer.  To enable hardware
  489.               flow control, call SioFlow with Tics > 0. "Tics" is  the  number
  490.               of  timer  tics  (18.2 per second) before a call to SioPutc will
  491.               time out because CTS was not set.
  492.  
  493.               In order for hardware flow control to work correctly, your modem
  494.               must also be configured to work with hardware flow control,  and
  495.               your  computer  to  modem  cable  must  have  RTS  and CTS wired
  496.               straight through. If you enable hardware flow  control,  do  not
  497.               modify  the  RTS  line  (by  calling  SioRTS).
  498.  
  499.               Flow control is disabled after resetting a port.  To  explicitly
  500.               disable hardware flow control, call SioFlow with Flag=FALSE.
  501.  
  502.    Returns    -2 : Port not enabled. Call SioReset first.
  503.               -4 : No such port.  Expect 0 to MaxPort.
  504.               =0 : Flow control disabled.
  505.               >0 : Flow control enabled.
  506.  
  507.   See Also    SioPutc
  508.  
  509.  
  510.   +------------+-------------------------------------------------------------+
  511.   |   SioGetc  |  Reads the next character from the serial line.             |
  512.   +------------+-------------------------------------------------------------+
  513.  
  514.  
  515.     Syntax    FUNCTION SioGetc(ByVal Port,ByVal Tics)
  516.               REM Port: Port selected (COM1 thru COM20)
  517.  
  518.    Remarks    The SioGetc function reads a byte from the selected serial port.
  519.               The function will wait for the number of system  tics  given  by
  520.               the  'Tics'  argument  before  returning 'timed out'.  There are
  521.               18.2 tics to the second.
  522.  
  523.  
  524.    Returns    -2 : Port not enabled. Call SioReset first.
  525.               -4 : No such port. Expect 0 to MaxPort.
  526.               -1 : If timed out.
  527.               >0 : Character read.
  528.  
  529.   See Also    SioUnGetc and SioPutc.
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  PCL4VB   Reference   Manual                                       Page 8
  545.   +---------------+----------------------------------------------------------+
  546.   |   SioGetDiv   |  Reads the baud rate divisor.                            |
  547.   +---------------+----------------------------------------------------------+
  548.  
  549.  
  550.     Syntax    FUNCTION SioGetDiv(ByVal Port)
  551.               REM Port: Port selected (COM1 thru COM20)
  552.  
  553.  
  554.    Remarks     The  SioGetDiv  function reads the baud rate divisor. The baud
  555.               rate can then be determined by the divisor:
  556.  
  557.               Baud   Divisor      Baud  Divisor      Baud  Divisor
  558.                300    0180        4800   0018       38400   0003
  559.               1200    0060        9600   000C       57600   0002
  560.               2400    0030       19200   0006      115200   0001
  561.  
  562.    Returns    -2 : Port not enabled. Call SioReset first.
  563.               -4 : No such port. Expect 0 to MaxPort.
  564.               >0 : Baud rate divisor.
  565.  
  566.   See Also    SioParms.
  567.  
  568.  
  569.  
  570.   +-------------+------------------------------------------------------------+
  571.   |   SioInfo   |  Returns PCLVBW library information.                       |
  572.   +-------------+------------------------------------------------------------+
  573.  
  574.  
  575.     Syntax    FUNCTION SioInfo(ByVal Cmd)
  576.               REM Cmd: Command (See below)
  577.  
  578.    Remarks    The  SioInfo  function returns an integer code  corresponding to
  579.               the Cmd as follows
  580.  
  581.               Command   SioInfo returns
  582.                -1       Cannot recognize command.
  583.               ASC("V")  Library version number.
  584.               ASC("I")  TRUE (not 0) if transmitter interrupts are enabled.
  585.               ASC("T")  The accumulative total number of transmitter interrupts.
  586.               ASC("R")  The accumulative total number of receiver interrupts.
  587.  
  588.    Returns
  589.               See remarks above.
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  PCL4VB   Reference   Manual                                       Page 9
  613.   +-------------+------------------------------------------------------------+
  614.   |    SioIRQ   |  Assigns an IRQ line to a port.                            |
  615.   +-------------+------------------------------------------------------------+
  616.  
  617.  
  618.     Syntax    FUNCTION SioIRQ(ByVal Port,ByVal IRQcode)
  619.               REM Port:    Port selected (COM1 thru COM20)
  620.               REM IRQcode: IRQ number [IRQ2..IRQ15]
  621.  
  622.    Remarks    The SioIRQ function assigns an IRQ line to  a  port.   That  is,
  623.               SioIRQ  maps  an  IRQ  to a port.  SioIRQ (like SioUART) must be
  624.               called before calling SioReset. Unless you have  a  non-standard
  625.               (COM1  &  COM3  use IRQ4 while COM2 & COM4 use IRQ3) serial port
  626.               configuration  (or  don't  want  to  run  more  than   2   ports
  627.               concurrently),  you  will not need to call SioIRQ.  Be EXTREMELY
  628.               careful with SioIRQ as it can lock  your  machine  up  if  given
  629.               incorrect information.
  630.  
  631.               In particular, remember that your port  hardware  must  generate
  632.               the interrupt that you have specified.  You should refer to your
  633.               serial   board  hardware  manual  for  specfic  instructions  in
  634.               configuring your hardware.  Be sure to call  SioPorts  first  to
  635.               setup  DigiBoard  ports  if  you have them.  Refer to the PCLVBW
  636.               Users Manual for additional information.
  637.  
  638.  
  639.    Returns    -4 : No such port. Expect 0 to MaxPort.
  640.              -15 : Port already enabled.  SioReset has already been called.
  641.              |17 : No such IRQ.
  642.              -18 : ISR limit (maximum of 4 PC IRQs) exceeded.
  643.                0 : Otherwise
  644.  
  645.   See Also    SioUART and SioPorts.
  646.  
  647.  
  648.   +-------------+------------------------------------------------------------+
  649.   |   SioLine   |  Reads the line status register.                           |
  650.   +-------------+------------------------------------------------------------+
  651.  
  652.  
  653.     Syntax    FUNCTION SioLine(ByVal Port)
  654.               REM Port: Port selected (COM1 thru COM20)
  655.  
  656.    Remarks    The  SioLine  function  reads  the  line  status  register.  The
  657.               individual bit masks are as follows:
  658.  
  659.               &H40  = Transmitter empty.
  660.               &H20  = Transmitter buffer empty.
  661.               &H10  = Break detected.
  662.               &H08  = Framming error.
  663.               &H04  = Parity error.
  664.               &H02  = Overrun error.
  665.               &H01  = Data ready.
  666.  
  667.               The above are documented in the file PCLVBW.BAS.
  668.  
  669.    Returns    -2 : Port not enabled. Call SioReset first.
  670.               -4 : No such port. Expect 0 to MaxPort.
  671.               >0 : Line status (rightmost byte of word).
  672.  
  673.   See Also    SioModem.
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  PCL4VB   Reference   Manual                                       Page 10
  681.   +-------------+------------------------------------------------------------+
  682.   | SioLoopBack |  Does a UART loopback test.                                |
  683.   +-------------+------------------------------------------------------------+
  684.  
  685.  
  686.     Syntax    FUNCTION SioLoopBack(ByVal Port)
  687.               REM Port: Port selected (COM1 thru COM20)
  688.  
  689.    Remarks    SioLoopBack makes use of the built in loopback  test  capability
  690.               of  the  INS8250  family  UART.  Normally SioLoopBack will never
  691.               need to be called unless you suspect that your UART is bad. Many
  692.               UARTs must be reset after running a loopback test.
  693.  
  694.    Returns      0 : Loopback test is successfull.
  695.                -2 : Port not enabled. Call SioReset first.
  696.                -4 : No such port.  Expect 0 to MaxPort.
  697.               -12 : Loopback test fails.
  698.  
  699.  
  700.  
  701.   +-------------+------------------------------------------------------------+
  702.   |   SioModem  |  Reads the modem status register.                          |
  703.   +-------------+------------------------------------------------------------+
  704.  
  705.  
  706.     Syntax    FUNCTION SioModem(ByVal Port, ByVal Mask)
  707.               REM Port: Port selected (COM1 thru COM20)
  708.               REM Mask: Modem function mask
  709.  
  710.    Remarks    The  SioModem  function  reads  the  modem  register.    The bit
  711.               definitions for the function mask are as follows:
  712.  
  713.               Bit Name  Function               Bit  Name      Function
  714.                7  DCD   Data Carrier Detect     3   DeltaDCD  DCD has changed
  715.                6  RI    Ring Indicator          2   DeltaRI   RI has changed
  716.                5  DSR   Data Set Ready          1   DeltaDSR  DSR has changed
  717.                4  CTS   Clear To Send           0   DeltaCTS  CTS has changed
  718.  
  719.               Bits  4  through  7  represent  the  absolute  state  of   their
  720.               respective  RS-232  inputs.  Bits 0 through 3 represent a change
  721.               in the state of their respective RS-232 inputs since last  read.
  722.               Once UART register 3 is read, the Delta bits are cleared.  Thus,
  723.               it is best not to depend on the Delta bits.
  724.  
  725.  
  726.    Returns    -2 : Port not enabled. Call SioReset first.
  727.               -4 : No such port. Expect 0 to MaxPort.
  728.               >0 : Modem status (rightmost byte of word).
  729.  
  730.   See Also   SioCTS, SioDCD, SioDSR and SioRI.
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  PCL4VB   Reference   Manual                                       Page 11
  749.   +-------------+------------------------------------------------------------+
  750.   |  SioParms   |  Sets parity, stop bits, and word length.                  |
  751.   +-------------+------------------------------------------------------------+
  752.  
  753.  
  754.    Syntax     FUNCTION SioParms(ByVal Port,ByVal Parity,
  755.                                   ByVal StopBits,ByVal DataBits)
  756.               REM Port:     Port selected (COM1 - COM20)
  757.               REM Parity:   Parity code [0,1,2]
  758.               REM StopBits: Stop bits code [0,1]
  759.               REM DataBits: Word length code [0,1,2,3]
  760.  
  761.    Remarks    The SioParms function sets  the  parity,  stop  bits,  and  word
  762.               length.   If  the  default parity (none), stop bits (1), or word
  763.               length (8) is not  acceptable,  then  they  can  be  changed  by
  764.               calling SioParms.  SioParms can be called either before or after
  765.               calling SioReset. See file PCLVBW.BAS. (8 = default)
  766.  
  767.                             Value   Description    PCLVBW.BAS Name
  768.               ParityCode:    *0      no parity      NoParity
  769.                               1      odd parity     OddParity
  770.                               3      even parity    EvenParity
  771.               StopBitsCode:  *0      1 stop bit     OneStopBit
  772.                               1      2 stop bits    TwoStopBits
  773.               WordLengthCode: 0      5 data bits    WordLength5
  774.                               1      6 data bits    WordLength6
  775.                               2      7 data bits    WordLength7
  776.                              *3      8 data bits    WordLength8
  777.  
  778.   Returns     -4 : No such port. Expect 0 to MaxPort.
  779.               -7 : Bad parity code selected. Expecting  0 to 2.
  780.               |8 : Bad stop bits code. Expecting  0 or 1.
  781.               -9 : Bad word length code. Expecting  0 to 3.
  782.  
  783.  See Also    SioReset.
  784.  
  785.  
  786.   +-------------+------------------------------------------------------------+
  787.   |  SioPorts   |  Sets number of PC & Digiboard / BOCA Board ports.         |
  788.   +-------------+------------------------------------------------------------+
  789.  
  790.  
  791.     Syntax    FUNCTION SioPorts(ByVal NbrPorts,ByVal FirstPort,
  792.                                   ByVal StatusReg,ByVal Code)
  793.               REM NbrPorts:  Total number of ports
  794.               REM FirstPort: First DigiBoard port
  795.               REM StatusReg: DigiBoard Status Register
  796.               REM Code:      PC_PORTS, DIGIBOARD, or BOCABOARD
  797.  
  798.    Remarks    The SioPorts function must be called  before  ANY  other  serial
  799.               functions.   The  purpose of the SioPorts function is to set the
  800.               total number of ports, the first DigiBoard (or BOCA board)  port
  801.               and the DigiBoard (or BOCA board) status register address.
  802.  
  803.               Once SioPorts is called, all COM ports starting with "FirstPort"
  804.               will be treated as DigiBoard (or BOCA board) ports.  The default
  805.               setup is 4 standard PC ports and no DigiBoard or  BOCA  ports  [
  806.               SioPorts(4,4,0,PC_PORTS) ].
  807.  
  808.               Refer  to  the  PCLVBW users maniual for more information on the
  809.               DigiBoard and BOCA board.
  810.  
  811.    Returns    -4 : No such port. Expect 0 to 9.
  812.               0 : No error (sets MaxPort to NumberPorts-1).
  813.  
  814.   See Also    SioUART, SioIRQ, and Code Examples.
  815.  
  816.  PCL4VB   Reference   Manual                                       Page 12
  817.   +-------------+------------------------------------------------------------+
  818.   |   SioPutc   |  Transmit a character over a serial line.                  |
  819.   +-------------+------------------------------------------------------------+
  820.  
  821.  
  822.     Syntax    FUNCTION SioPutc(ByVal Port,ByVal Ch)
  823.               REM Port: Port selected (COM1 thru COM20)
  824.               REM Ch:   Character to send [ASC(char)]
  825.  
  826.    Remarks    The SioPutc function transmits one character  over the  selected
  827.               serial line.
  828.  
  829.               If  flow  control has been enabled, then SioPutc may return a -1
  830.               (time out) if the  number  of  tics  specified  in  the  SioFlow
  831.               function was exceeded waiting for the modem to raise CTS.
  832.  
  833.               Refer to the User's Manual for a discussion of flow control.
  834.  
  835.               If  transmitter  interrupts  are  enabled  (there  are  separate
  836.               versions  of  the  library  for transmitter interrupts enabled),
  837.               then the  byte  is  placed  in  the  transmit  buffer,  awaiting
  838.               transmission by the PCLVBW interrupt service routine.
  839.  
  840.    Returns    -2 : Port not enabled. Call SioReset first.
  841.               -4 : No such port. Expect 0 to MaxPort.
  842.               -1 : Timed out waiting for CTS (flow control enabled)
  843.  
  844.   See Also    SioGetc and SioFlow.
  845.  
  846.  
  847.   +-------------+------------------------------------------------------------+
  848.   |   SioRead   |  Reads any UART register.                                  |
  849.   +-------------+------------------------------------------------------------+
  850.  
  851.  
  852.     Syntax    FUNCTION SioRead(ByVal Port,ByVal Reg)
  853.               REM Port: Port selected (COM1 thru COM20)
  854.               REM Reg:  UART register (0 to 7)
  855.  
  856.    Remarks    The SioReset function directly reads the contents of any of  the
  857.               7  UART  registers.   This  function  is  useful  when debugging
  858.               application  programs  and  as  a  method  for  verifying   UART
  859.               contents.  Refer to the PCLVBW Users Manual for a discussion  of
  860.               the 7 UART registers.
  861.  
  862.               The  line  status  register  (register  5) can also be read with
  863.               SioLine while the modem status register (register 6) can also be
  864.               read with SioModem.  Refer to the PCLVBW  User's  Manual  for  a
  865.               discussion of the UART registers.
  866.  
  867.    Returns     -3 : No buffer available. Call SioRxBuf and SioTxBuf first.
  868.                -4 : No such port. Expect 0 to MaxPort.
  869.  
  870.   See Also    SioLine and SioModem.
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  PCL4VB   Reference   Manual                                       Page 13
  885.   +-------------+------------------------------------------------------------+
  886.   |  SioReset   |  Initialize a serial port for processing.                  |
  887.   +-------------+------------------------------------------------------------+
  888.  
  889.  
  890.     Syntax    FUNCTION SioReset(ByVal Port,ByVal BaudCode)
  891.               REM Port:     Port selected (COM1 thru COM20)
  892.               REM BaudCode: Baud code or -1
  893.  
  894.    Remarks    The SioReset function  initializes  the  selected  serial  port.
  895.               SioReset should be called after calling SioParm and SioRxBuf but
  896.               before  making  any  other  calls  to PCLVBW.  SioReset uses the
  897.               parity, stop bits, and  word  length  value  previously  set  if
  898.               SioParm  was  called, otherwise the default values (see SioParm)
  899.               are used.
  900.  
  901.               Recall that COM1 and COM3 share the same  interrupt  vector  and
  902.               therefore  cannot  operate  simultaneously. Similiarly, COM2 and
  903.               COM4 cannot operate simultaneously. Any other combination of two
  904.               ports can be used.
  905.  
  906.               By specifing NORESET (-1) for the baud rate code, the port  will
  907.               NOT  be  reset.   This is used to "take over" a port from a host
  908.               communications program that allows a  "DOS  gateway".   External
  909.               protocols  can  be implemented this way.  See SioBaud for a list
  910.               of the baud rate codes, or see "PCLVBW.BAS".
  911.  
  912.    Returns     -3 : No buffer available. Call SioRxBuf & SioTxBuf first.
  913.                -4 : No such port. Expect 0 to MaxPort.
  914.               -11 : Bad baud rate code selected. Expecting  0 to 9.
  915.               |13 : UART undefined.  SioUART(Port,0) was called previously.
  916.               |14 : Bad or missing UART.  You may not have hardware present.
  917.               |15 : Port already enabled.  SioReset has already been called.
  918.               -16 : Interrupt already in use.
  919.  
  920.   See Also    SioBaud, SioParms, SioRxBuf, SioDone, and SioUART.
  921.  
  922.  
  923.  
  924.   +-------------+------------------------------------------------------------+
  925.   |    SioRI    |  Reads the Ring Indicator (RI) modem status bit.           |
  926.   +-------------+------------------------------------------------------------+
  927.  
  928.  
  929.     Syntax    FUNCTION SioRI(ByVal Port)
  930.               REM Port: Port selected (COM1 thru COM20)
  931.  
  932.    Remarks    The SioRI function is used to read the Ring  Indicator
  933.               (RI) modem status bit. Also see SioModem.
  934.  
  935.    Returns    -2 : Port not enabled. Call SioReset first.
  936.               -4 : No such port.  Expect 0 to MaxPort.
  937.                0 : RI is clear.
  938.               >0 : RI is set (RING has occurred).
  939.  
  940.   See Also    SioDSR, SioCTS, SioDCD, and SioModem.
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  PCL4VB   Reference   Manual                                       Page 14
  953.   +-------------+------------------------------------------------------------+
  954.   |    SioRTS   |  Sets, clears, or reads the Request to Send (RTS) line.    |
  955.   +-------------+------------------------------------------------------------+
  956.  
  957.  
  958.     Syntax    FUNCTION SioRTS(ByVal Port, ByVal Cmd)
  959.               REM Port: Port selected (COM1 thru COM20)
  960.               REM Cmd:  RTS command (SET, CLEAR, or READ)
  961.  
  962.    Remarks    The SioRTS function controls the Request to Send (RTS bit in the
  963.               modem control register.
  964.  
  965.               The  RTS  line  is  used  by  some  error  correcting  modems to
  966.               implement hardware flow control.  RTS is dropped by the computer
  967.               to signal the modem not to send data, and is  raised  to  signal
  968.               the modem to continue. RTS should be set when communicating with
  969.               a modem unless Flow Control is being used.
  970.  
  971.               Refer  to  the  User's  Manual for a discussion of flow control.
  972.               Commands (defined in PCLVBW.BAS) are:
  973.  
  974.               SET_LINE     ASC("S")   - set RTS (ON)
  975.               CLEAR_LINE   ASC("C")   | clear RTS (OFF)
  976.               READ_LINE    ASC("R")   - read RTS
  977.  
  978.    Returns    -2 : Port not enabled. Call SioReset first.
  979.               -4 : No such port. Expect 0 to MaxPort.
  980.               -5 : Command is not one of 'S', 'C', or 'R'.
  981.                0 : RTS is OFF (READ_LINE Command).
  982.               >0 : RTS is ON  (READ_LINE Command).
  983.  
  984.   See Also    SioFlow and SioDTR.
  985.  
  986.  
  987.   +------------+-------------------------------------------------------------+
  988.   |  SioRxBuf  |  Sets up receive buffers.                                   |
  989.   +------------+-------------------------------------------------------------+
  990.  
  991.  
  992.     Syntax    FUNCTION SioRxBuf(ByVal Port,ByVal Selector,ByVal SizeCode)
  993.               REM Port:      Port selected (COM1 thru COM20)
  994.               REM Selector:  Receive buffer selector
  995.               REM SizeCode:  Buffer size code
  996.  
  997.    Remarks     The  SioRxBuf  function passes the address selector and size of
  998.               the receive buffer to PCLVBW.  Recall  that  PCLVBW  requires  a
  999.               receive buffer for each port in simultaneous operation since the
  1000.               receive  function is interrupt driven.  It must be called before
  1001.               any incoming characters can be received. SioRxBuf must be called
  1002.               before SioReset.  Buffer size codes are listed in "PCLVBW.BAS".
  1003.  
  1004.               Size Code       Buffer Size    PCLVBW.BAS Name
  1005.                  4            128 bytes        Size128
  1006.                  5            256 bytes        Size256
  1007.                  6            512 bytes        Size512
  1008.                  7           1024 bytes        Size1024 or Size1K
  1009.                  8           2048 bytes        Size2048 or Size2K
  1010.                  9           4096 bytes        Size4096 or Size4K
  1011.                 10           8192 bytes        Size8192 or Size8K
  1012.                 11          16384 bytes        Size16384 or Size16K
  1013.                 12          32768 bytes        Size32768 or Size32K
  1014.  
  1015.    Returns    -4 : No such port. Expect 0 to MaxPort.
  1016.              -10 : Bad buffer size code. Expecting 0 to 11.
  1017.  
  1018.   See Also    SioReset and Code Examples.
  1019.  
  1020.  PCL4VB   Reference   Manual                                       Page 15
  1021.   +------------+-------------------------------------------------------------+
  1022.   | SioRxClear |  Clears the receive buffer.                                 |
  1023.   +------------+-------------------------------------------------------------+
  1024.  
  1025.  
  1026.     Syntax    FUNCTION SioRxClear(ByVal Port)
  1027.               REM Port: Port selected (COM1 thru COM20)
  1028.  
  1029.    Remarks    The SioRxClear  function  will  delete  any  characters  in  the
  1030.               receive  buffer  for  the  specified port.  After execution, the
  1031.               receive buffer will be empty.  Call SioRxClear after resetting a
  1032.               port in order to delete any spurious characters.
  1033.  
  1034.    Returns    -2 : Port not enabled. Call SioReset first.
  1035.               -4 : No such port. Expect 0 to MaxPort.
  1036.  
  1037.   See Also    SioRxQue.
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.   +-------------+------------------------------------------------------------+
  1045.   |  SioRxQue   |  Returns the number of bytes in the receive queue.         |
  1046.   +-------------+------------------------------------------------------------+
  1047.  
  1048.  
  1049.     Syntax    FUNCTION SioRxQue(ByVal Port)
  1050.               REM Port: Port selected (COM1 thru COM20)
  1051.  
  1052.    Remarks    The  SioRxQue  function  will return the number of characters in
  1053.               the receive queue at the time of the call. It  can  be  used  to
  1054.               implement XON/XOFF flow control.
  1055.  
  1056.    Returns    -2 : Port not enabled. Call SioReset first.
  1057.               -4 : No such port. Expect 0 to MaxPort.
  1058.  
  1059.   See Also     SioRxFlush.
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  PCL4VB   Reference   Manual                                       Page 16
  1089.   +------------+-------------------------------------------------------------+
  1090.   |  SioTxBuf  |  Sets up transmitter buffer.                                |
  1091.   +------------+-------------------------------------------------------------+
  1092.  
  1093.  
  1094.     Syntax    FUNCTION SioTxBuf(ByVal Port,ByVal Selector,ByVal SizeCode)
  1095.               REM Port:     Port selected (COM1 thru COM20)
  1096.               REM Selector: Receive buffer selector
  1097.               REM SizeCode: Buffer size code
  1098.  
  1099.    Remarks    The  SioTxBuf  function passes the address selector and  size  of
  1100.               the transmit buffer to PCLVBW, provided that you will link  with
  1101.               a  PCLVBW  library  with transmitter interrupts enabled.  PCLVBW
  1102.               requires  a  transmit  buffer  for  each  port  in  simultaneous
  1103.               operation  if  you  are  using  the  version of the library with
  1104.               transmitter interrupts enabled (PCLVBW2.LIB).   SioTxBuf()  must
  1105.               be called before SioReset.
  1106.  
  1107.               Size Code       Buffer Size    PCLVBW.BAS Name
  1108.                  4            128 bytes        Size128
  1109.                  5            256 bytes        Size256
  1110.                  6            512 bytes        Size512
  1111.                  7           1024 bytes        Size1024 or Size1K
  1112.                  8           2048 bytes        Size2048 or Size2K
  1113.                  9           4096 bytes        Size4096 or Size4K
  1114.                 10           8192 bytes        Size8192 or Size8K
  1115.                 11          16384 bytes        Size16384 or Size16K
  1116.                 12          32768 bytes        Size32768 or Size32K
  1117.  
  1118.               This  function is not used unless the transmitter interrupts are
  1119.               enabled (the  default  library).   Refer  to  the  PCLVBW  Users
  1120.               Manual for information on transmitter (TX) interrupts.
  1121.  
  1122.    Returns     -4 : No such port. Expect 0 to MaxPort.
  1123.               -10 : Bad buffer size code. Expecting 0 to 11.
  1124.  
  1125.   See Also    SioRxBuf, SioReset and Code Examples.
  1126.  
  1127.  
  1128.   +------------+-------------------------------------------------------------+
  1129.   | SioTxClear |  Clears the transmitter buffer.                             |
  1130.   +------------+-------------------------------------------------------------+
  1131.  
  1132.  
  1133.     Syntax    FUNCTION SioTxClear(ByVal Port)
  1134.               REM Port: Port selected (COM1 thru COM20)
  1135.  
  1136.    Remarks    The SioTxClear  function  will  delete  any  characters  in  the
  1137.               transmit  buffer  for the specified port, provided that you will
  1138.               link with a PCLVBW library with transmitter interrupts  enabled.
  1139.               After execution, the transmit buffer will be empty.
  1140.  
  1141.               Once  this  function  is  called,  any character in the transmit
  1142.               buffer (put there by SioPutc) will be  lost  and  therefore  not
  1143.               transmitted.   This  function is not used unless the transmitter
  1144.               interrupts are enabled Refer to  the  PCLVBW  Users  Manual  for
  1145.               information on transmitter (TX) interrupts.
  1146.  
  1147.    Returns    -2 : Port not enabled. Call SioReset first.
  1148.               -4 : No such port. Expect 0 to MaxPort.
  1149.  
  1150.   See Also    SioTxQue & SioTxFlush.
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  PCL4VB   Reference   Manual                                       Page 17
  1157.   +------------+-------------------------------------------------------------+
  1158.   | SioTxFlush |  Flushes the transmitter buffer characters.                 |
  1159.   +------------+-------------------------------------------------------------+
  1160.  
  1161.  
  1162.     Syntax    FUNCTION SioTxFlush(ByVal Port)
  1163.               REM Port: Port selected (COM1 thru COM20)
  1164.  
  1165.    Remarks    The SioTxFlush  function  will  transmit any  characters  in  the
  1166.               transmit  buffer before returning. In order to clear the buffer,
  1167.               call SioTxClear instead.
  1168.  
  1169.    Returns    -2 : Port not enabled. Call SioReset first.
  1170.               -4 : No such port. Expect 0 to MaxPort.
  1171.  
  1172.   See Also    SioTxQue & SioTxClear.
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.   +------------+-------------------------------------------------------------+
  1180.   |  SioTxQue  |  Returns the number of bytes in the transmit queue.         |
  1181.   +------------+-------------------------------------------------------------+
  1182.  
  1183.  
  1184.     Syntax    FUNCTION SioTxQue(ByVal Port)
  1185.               REM Port: Port selected (COM1 thru COM20)
  1186.  
  1187.    Remarks    The SioTxQue function will return the number  of  characters  in
  1188.               the  transmit  queue  at the time of the call, provided that you
  1189.               will link with a  PCLVBW  library  with  transmitter  interrupts
  1190.               enabled.
  1191.  
  1192.               This  function is not used unless the transmitter interrupts are
  1193.               enabled.  Refer to the PCLVBW Users Manual  for  information  on
  1194.               transmitter (TX) interrupts.
  1195.  
  1196.    Returns    -2 : Port not enabled. Call SioReset first.
  1197.               -4 : No such port. Expect 0 to MaxPort.
  1198.  
  1199.   See Also     SioTxFlush.
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  PCL4VB   Reference   Manual                                       Page 18
  1225.   +------------+-------------------------------------------------------------+
  1226.   |  SioUART   |  Sets the UART base address.                                |
  1227.   +------------+-------------------------------------------------------------+
  1228.  
  1229.  
  1230.     Syntax    FUNCTION SioUART(ByVal Port,ByVal Address)
  1231.               REM Port:    Port selected (COM1 thru COM20)
  1232.               REM Address: UART address
  1233.  
  1234.    Remarks    The  SioUART  function  sets  the  UART  base  address  for  the
  1235.               specified port.  SioUART must be called before SioReset in order
  1236.               to  have  effect.   Be extremely sure that you know what you are
  1237.               doing!   Note  that  PCLVBW  uses  the  standard  PC/XT/AT  port
  1238.               addresses,   interrupt  request  lines,  and  interrupt  service
  1239.               vectors.   Therefore,  this  function   is   only   needed   for
  1240.               non-standard ports.
  1241.  
  1242.    Returns    >0 : The previous base address for this port.
  1243.               -4 : No such port.  Expect 0 to MaxPort.
  1244.              -15 : Port already enabled.  SioReset has already been called.
  1245.  
  1246.   See Also    SioPorts, SioIRQ, and SioReset.
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.   +------------+-----+-------------------------------------------------------+
  1255.   | SioUnGetc  |  "Un|gets" the last character read with SioGetc().          |
  1256.   +------------+-----+-------------------------------------------------------+
  1257.  
  1258.  
  1259.     Syntax    FUNCTION SioUnGetc(ByVal Port,ByVal Ch)
  1260.               REM Port: Port selected (COM1 thru COM20)
  1261.               REM Ch:   Character to unget
  1262.  
  1263.    Remarks    The SioUnGetc function returns  ("pushes")  the  character  back
  1264.               into  the serial input buffer.  The character pushed will be the
  1265.               next character returned by SioGetc.  Only one character  can  be
  1266.               pushed back. This function works just like the "ungetc" function
  1267.               in the C language.
  1268.  
  1269.    Returns    -2 : Port not enabled. Call SioReset first.
  1270.               -4 : No such port. Expect 0 to MaxPort.
  1271.  
  1272.   See Also    SioReset.
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  PCL4VB   Reference   Manual                                       Page 19
  1293.                            Function Sumary
  1294.  
  1295.  
  1296.  
  1297.        +-------------+----------+----------+----------+----------+
  1298.        | Function    |   Arg1   |   Arg2   |   Arg3   |   Arg4   |
  1299.        +-------------+----------+----------+----------+----------+
  1300.        | SioBaud     | Port     | BaudCode |          |          |
  1301.        | SioBrkSig   | Port     | Cmd      |          |          |
  1302.        | SioCTS      | Port     |          |          |          |
  1303.        | SioDCD      | Port     |          |          |          |
  1304.        | SioDone     | Port     |          |          |          |
  1305.        | SioDSR      | Port     |          |          |          |
  1306.        | SioDTR      | Port     | Cmd      |          |          |
  1307.        | SioFIFO     | Port     | LevelCode|          |          |
  1308.        | SioFlow     | Port     |          |          |          |
  1309.        | SioGetc     | Port     | Tics     |          |          |
  1310.        | SioGetDiv   | Port     |          |          |          |
  1311.        | SioInfo     | Cmd      |          |          |          |
  1312.        | SioIRQ      | Port     | IRQcode  |          |          |
  1313.        | SioLine     | Port     |          |          |          |
  1314.        | SioLoopBack | Port     |          |          |          |
  1315.        | SioModem    | Port     | Mask     |          |          |
  1316.        | SioParms    | Port     | Parity   | StopBits | DataBits |
  1317.        | SioPorts    | NbrPorts | FirstDBP |StatusReg | Code     |
  1318.        | SioPutc     | Port     | Ch       |          |          |
  1319.        | SioRead     | Port     | Register |          |          |
  1320.        | SioReset    | Port     | BaudCode |          |          |
  1321.        | SioRI       | Port     |          |          |          |
  1322.        | SioRTS      | Port     | Cmd      |          |          |
  1323.        | SioRxBuf    | Port     | BufSeg   | SizeCode |          |
  1324.        | SioRxClear  | Port     |          |          |          |
  1325.        | SioRxQue    | Port     |          |          |          |
  1326.        | SioTxBuf    | Port     | BufSeg   | SizeCode |          |
  1327.        | SioTxClear  | Port     |          |          |          |
  1328.        | SioTxFlush  | Port     |          |          |          |
  1329.        | SioTxQue    | Port     |          |          |          |
  1330.        | SioUART     | Port     | Address  |          |          |
  1331.        | SioUnGetc   | Port     | Ch       |          |          |
  1332.        +-------------+----------+----------+----------+----------+
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  PCL4VB   Reference   Manual                                       Page 20
  1361.                            Error Code Summary
  1362.  
  1363.  
  1364.  
  1365.   +------+--------------------------------------------------------+
  1366.   | Code |  Description                                           |
  1367.   +------+--------------------------------------------------------+
  1368.   |   0  |  No error.                                             |
  1369.   |  -1  |  Timeout waiting for I/O.                              |
  1370.   |  -2  |  Port not enabled. Call SioReset first.                |
  1371.   |  -3  |  No buffer available. Call SioRxBuf and SioTxBuf first |
  1372.   |  -4  |  No such port. Expect COM1 to COM20.                   |
  1373.   |  -5  |  Expected 'S', 'C', or 'R' as 2nd argument.            |
  1374.   |  -6  |  Expected 'A', 'C', or 'D' as 2nd argument.            |
  1375.   |  -7  |  Bad parity code specified. Expected 0 to 7.           |
  1376.   |  -8  |  Bad stop bits code specified. Expected 0 or 1.        |
  1377.   |  -9  |  Bad wordlength code specified. Expected 0 to 3.       |
  1378.   | -10  |  Bad buffer size code specified. Expected 0 to 11.     |
  1379.   | -11  |  Bad baud rate code. Expected 0 to 9.                  |
  1380.   | -12  |  Loopback test fails.                                  |
  1381.   | -13  |  UART undefined.                                       |
  1382.   | -14  |  Missing or bad UART. (no UART hardware ?)             |
  1383.   | -15  |  Port already enabled.                                 |
  1384.   | -16  |  ISR (interrupt) already in use.                       |
  1385.   | -17  |  No such IRQ. (Should be 2 to 15)                      |
  1386.   | -18  |  ISR limit (maximum of 4 PC IRQs) exceeded.            |
  1387.   +------+--------------------------------------------------------+
  1388.  
  1389.  
  1390.                            Code Examples
  1391.  
  1392.  
  1393.   DigiBoard Example
  1394.  
  1395.   'status reg uses &H140 for odd IRQs & &H141 for even IRQs
  1396.   RC = SioPorts(8,COM1,&H140,DIGIBOARD)
  1397.   FOR I = COM1 TO COM20
  1398.     'set DigiBoard UART addresses
  1399.     RC = SioUART(i,&H100+8*i)
  1400.     'set DigiBoard for IRQ5
  1401.     RC = SioIRQ(I,IRQ5)
  1402.   NEXT I
  1403.  
  1404.   BOCA Board Example
  1405.  
  1406.   'status reg uses base port + 7
  1407.   RC = SioPorts(16,COM1,&H100+7,BOCABOARD)
  1408.   FOR I = COM1 TO COM16
  1409.     'set BOCA UART addresses
  1410.     RC = SioUART(i,&H100+8*i)
  1411.     'set BOCA for IRQ5
  1412.     RC = SioIRQ(I,IRQ5)
  1413.   NEXT I
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  PCL4VB   Reference   Manual                                       Page 21
  1429.